package com.wonghiu.provider;

import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration;
import com.wonghiu.framework.transport.netty.server.NettyRpcServer;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Author wonghiu
 * @Date 2021/8/11 16:30
 * @Version 1.0.1
 */
@Configuration
@ComponentScan(value = {"com.wonghiu.provider","com.wonghiu.api","com.wonghiu.framework"})
// 启动时，需要将DubboProviderMain的注解去掉，不然无法成功启动
public class LocalProviderMain {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(LocalProviderMain.class);
        NettyRpcServer nettyRpcServer = (NettyRpcServer) applicationContext.getBean("nettyRpcServer");
        Object helloServiceImp = applicationContext.getBean("helloServiceHRpcImp");
        nettyRpcServer.start();
    }
}
